<?php
namespace Common\Model;
use Think\Model\RelationModel;
class UsersModel extends RelationModel{
	protected $_link = array(
			'group_id'=>array(
					'mapping_type'=>self::HAS_ONE,
					'class_name'  =>'AuthGroupAccess',
					'foreign_key'=>'uid',
					'condition' => '`group`="admin"',
					'as_fields'=> 'group_id',
			),
			'did' => array(
					'mapping_type'=>self::HAS_ONE,
					'class_name'  =>'UsersDistrictRelation',
					'foreign_key'=>'uid',
					//'condition' => '`group`="admin"',
					'as_fields'=> 'did',
			),
			'english' => array(
					'mapping_type'=>self::HAS_ONE,
					'class_name'  =>'UsersEnglish',
					'foreign_key'=>'uid',
					//'condition' => '`group`="admin"',
					'as_fields'=> 'english',
			),
	);
}